package com.example.cuibo.basicarray.cn.itcast.list;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * Created by cuibo on 2017/10/31.
 */

public class 去掉重复字符串 {
    ArrayList list = new ArrayList();
    private void xxx(){

        list.add("11");
        list.add("11");
        list.add("11");
        list.add("11");

        ArrayList newList = getStrin(list);
    }

    public static ArrayList getStrin(ArrayList str){

        ArrayList newList = new ArrayList();
        Iterator it = str.iterator();
        while (it.hasNext()){
            String temp = (String)it.next();
            if (!newList.contains(temp)){
                newList.add(temp);
            }
        }
        return newList;
    }
}
